/*
 * config.h
 *
 *  Created on: 2010-4-15
 *      Author: chy.
 */

#ifndef CONFIG_H_
#define CONFIG_H_

// RAM start address in hard system
#define K_SYS_RAM_START_ADDR	0x00000000

// size of virtual space which OS will use fixed
#define K_SYS_MEM_VIR_SIZE		512	// virtual space of OS.In current space, virtual address and physical space will used in fixed relations!







/**************************************************************
 * 		I/O Mapping MMU Reference							  *
***************************************************************/
// size of I/O mapping space (in MBs)
#define K_SYS_IO_SPACE_SIZE		512	// we'd better do not change this value!No matter how less the real size is!
// define the I/O physical mapping start and end address, must be sure that the space of address is K_SYS_MEM_VIR_SIZE
#define	K_SYS_IO_PHYSICAL_START_ADDR	0x48000000
#define	K_SYS_IO_PHYSICAL_END_ADDR		(K_SYS_IO_PHYSICAL_START_ADDR + K_SYS_MEM_VIR_SIZE)
#define	K_SYS_IO_VIRTUAL_START_ADDR		(K_SYS_MEM_VIR_SIZE << 20)
#define	K_SYS_IO_VIRTUAL_END_ADDR		((K_SYS_MEM_VIR_SIZE + K_SYS_IO_SPACE_SIZE) << 20)

// define OS size.
#define K_SYS_SIZE			256			// 256, this value is count of phyical page count. so this is 1MB

// heap pool size of OS max value and default value in bytes
// OS will start with size K_SYS_OS_HEAP_DEFAULTSIZE. and it will inc, but limited by this value.
#define	K_SYS_OS_HEAP_DEFAULTSIZE	128 << 10	//
#define	K_SYS_OS_HEAP_MAXSIZE		512 << 10	// default 512K

/**  **/
#define	K_SYS_OS_HEAP_GCFREQ		1			// must 1. otherwise, there will be memory witch can't be free

// Process memory space macros
#define K_SYS_PROCESS_CODECONST_START   	(K_SYS_MEM_VIR_SIZE + K_SYS_IO_SPACE_SIZE)      // must in MBs(And Must be Bound 4MB)
#define K_SYS_PROCESS_CODECONST_END    		2048    // must in MBs
#define K_SYS_PROCESS_HEAPSTACKSTART_START  K_SYS_PROCESS_CODECONST_END    // must in MBs
#define K_SYS_PROCESS_HEAPSTACKSTART_END    4096    // must in MBs

// count in MB	System memory size.RAM size!
#define	K_VAL_MAXMEMSIZE			64			// count in MB!

// size per page.can't modify!
#define	K_VAL_PAGESIZE				4096

// second level page table element count per first level page table
#define	K_VAL_SECCPERFST			256

// first level page table bits. can't modify!
#define K_VAL_FMPT_BITS				12			// arm in small page, is 12

// second level page table bits.can't modify!
#define	K_VAL_SMPT_BITS				8			// arm in small page, is 8

// third level page table bits.can't modify!
#define	K_VAL_TMPT_BITS				12			// arm in small page, is 12

/** these macro we can open just one or close all!!!!! **/
// if cp15 support page write-back, we should open this macro!
#define	__K_MMU_USE_WRITEBACK__		1
// if cp15 support page buffer-noncache, we should open this macro!
#define	__K_MMU_USE_BUFCACHE__		0

#endif /* CONFIG_H_ */
